Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Update documents.rst #1514

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ibrahim-ogunbiyi wants to merge 1 commit into python-openxml:master
base: master
Choose a base branch
Loading
from ibrahim-ogunbiyi:patch-2

Conversation

@ibrahim-ogunbiyi
Copy link

@ibrahim-ogunbiyi ibrahim-ogunbiyi commented Aug 21, 2025

I think it's best to replace StringIO with BytesIO since we are working with bytes. This ensures that beginners, or anyone skimming the documentation and copying code, end up with correct and functional code.

cksachdev reacted with thumbs up emoji
I think it's best to replace `StringIO` with `BytesIO` since we are working with bytes. This ensures that beginners, or anyone skimming the documentation and copying code, end up with correct and functional code.

with open('foobar.docx', 'rb') as f:
source_stream = StringIO(f.read())
source_stream = BytesIO(f.read())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, interesting. I'm sure this is an artifact of this documentation being written during the Python 2 era, when StringIO actually meant "read bytes".

I'll put it on the shortlist and fix it up next time I'm in there.

Copy link
Author

Alright noted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@scanny scanny scanny left review comments

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /